﻿@model Kaqaz.Models.Post

@{
    ViewBag.Title = Model.Title;
}

<div class="post-header">
<div class="post-time">@GlobalDateTime.ToLongDateString(Model.CreateTime.Value)</div>
<div class="post-title">@Model.Title</div>
</div>

<div class="post-summary">@Html.Raw(Model.Summary)</div>

<div class="post-content">@Html.Raw(Model.Content)</div>

<div class="post-hits">
    تعداد مراجعه: @Model.Hits
</div>

@if (Model.LastUpdateTime.HasValue)
{
    <div class="post-lastupdate">@Resource.LastUpdateTime: @GlobalDateTime.ToLongDateString(Model.LastUpdateTime.Value)</div>
}

<p>
    @if (Xoqal.Security.Authentication.Default.IsUserInPermission(Kaqaz.Common.Security.Permissions.PostManagement)) 
    {
        <text>
        @Html.ActionLink(Resource.Edit, "Edit", new { id = Model.Id }) |
        </text>
    }
    @Html.ActionLink(Resource.Back, "Index")
</p>

<div>
    <div class="comments-separator">
        <div class="comments-separator-header">
            <a href="javascript:void()" onclick="$('#comments').toggle('slow')">دیدگاه‌ها (@Model.VisibleComments.Count())</a>
        </div>
    </div>
</div>

<div id="comments">
@Html.Partial("Comments", Model)
</div>

@if (string.IsNullOrWhiteSpace(Request.QueryString["sc"]))
{
    <script type="text/javascript">
        $('#comments').hide();
    </script>
}